#ifndef _WDS_ENEMY_MANAGER_H_
#define _WDS_ENEMY_MANAGER_H_

#include "ui/ui_manager.h"
#include "wds_enemy.h"
#include "wds_player.h"			// there's no point, enemy without a player, isn't it?

class WDSEnemyCollection;
class WDSBullet;

class WDSEnemyManager
{
public:

	
	static WDSEnemyManager&				    Instance();
	

	void									RenderDecal(const math::Vec2& Offset,float Scale);
	void									RenderDead(const math::Vec2& Offset,float Scale);
	void									Render(const math::Vec2& Offset,float Scale);	
	void									RenderShadow(const math::Vec2& Offset,float Scale);	
	void									RenderDebug(const math::Vec2& Offset,float Scale);
	void									Tick(float dt,float GameDifficulty, float PlayerReflex, const math::Vec2& Offset);
	


	void									Clear();	
	void									Spawn(	WDSEnemy::ENEMY_TYPES EnemyType,
													WDSEnemy::ENEMY_SPAWN_TYPE SpawnType,
													const math::Vec2& Offset
													);

	int										GetCount() const;
	bool									HitTest(WDSBullet* pBullet);
	WDSLifeObject*							GetRocketSeekerTarget(WDSBullet* pBullet);

	void									DoDamangeToAll(float DamageAmount);
	
	void									ForceKillAll();
	WDSPlayer*								GetPlayer() { return m_pPlayer; };
	void									SetPlayer(WDSPlayer* pPlayer) { m_pPlayer = pPlayer; };
	void									GetEnemyCollection(std::vector<WDSEnemyCollection*>& EnemyCollection) { EnemyCollection = m_EnemyCollections; };
	void									Freeze();
	
	void									RenderShadowInPos(const math::Vec2& Pos, 
															float Rotation,
															const math::Vec2& Offset, 
															float Scale);

protected:

	WDSEnemyManager();
	~WDSEnemyManager();


	std::vector<WDSEnemyCollection*>		m_EnemyCollections;
	WDSPlayer*								m_pPlayer;
	float									m_FreezeCounter;
	ui::UISprite							m_EnemyShadow;	

};

#endif